package com.wsgxj.vo;

import java.util.LinkedHashMap;
import java.util.Map;

public class Query extends LinkedHashMap<String, Object>{

	private static final long serialVersionUID = 1L;
	
	public Query(Map<String, Object> params) {
		this.putAll(params);
		
		//分页参数
		Integer limit = Integer.parseInt(params.get("limit").toString());
		Integer offset = Integer.parseInt(params.get("offset").toString());
		this.put("limit", limit);
		this.put("offset", offset);
		
		//防止sql注入（因为sidx、order是通过拼接sql实现排序的，会有sql注入风险
		/*
		 * String sidx = params.get("sidx").toString(); String order =
		 * params.get("order").toString(); this.put("sidx", SQLFilter.sqlInject(sidx));
		 * this.put("order", SQLFilter.sqlInject(order));
		 */
	}
}
